
package com.jims.master.modules.doctor.dao;

import com.jims.master.common.persistence.CrudDao;
import com.jims.master.common.persistence.annotation.MyBatisDao;
import com.jims.master.common.web.impl.BaseDto;
import com.jims.master.modules.doctor.entity.PrescriptionApply;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 门诊处方主表DAO接口
 * @author CTQ
 * @version 2017-03-13
 */
@MyBatisDao
public interface PrescriptionApplyDao extends CrudDao<PrescriptionApply> {

    /**
     * 门诊待发药处方药品list查询
     * @param prescriptionApply
     * @return
     */
    public List<PrescriptionApply> findByClinicPage(PrescriptionApply prescriptionApply);

    /**
     * 住院待发药处方药品list查询
     * @param prescriptionApply
     * @return
     */
    public List<PrescriptionApply> findByInpPage(PrescriptionApply prescriptionApply);

    /**
     * 查询住院处方
     * @param visitId
     * @return
     * @author 赵宁
     */
    public List<PrescriptionApply> prescInfoSearch(@Param("visitId")String visitId);

    /**
     * 退费
     * @param prescriptionApply
     * @return
     */
    public int refundIng(PrescriptionApply prescriptionApply);

    public List<PrescriptionApply> selectHistory(@Param("patientId")String patientId);

    /**
     * 护士端--未尽处方
     * @param visitId
     * @return
     * @author 赵宁
     */
    public List<PrescriptionApply> prescInfoUnfinished(@Param("visitId")String visitId);

    /**
     * 护理-处方汇总表打印
     * @param prescriptionApply
     * @return
     */
    public List<BaseDto> prescNursesTimePrint(PrescriptionApply prescriptionApply);

    /**
     * 陈晓阳
     * 根据门诊医嘱Ids查询处方信息
     * @param ordersIds
     * @param orgId
     * @return
     */
    public List<BaseDto> findByOrdersId(@Param("ordersIds") List<String> ordersIds,@Param("orgId") String orgId);


    public List<BaseDto> getOutpPrescPrint(@Param("orgId") String orgId,@Param("clinicId") String clinicId,@Param("applyId") String applyId,@Param("applyOn") String applyOn,@Param("visitId")String visitId);

    public PrescriptionApply getPrintInfo(@Param("id") String id,@Param("applyOn") String applyOn);

    public int updateIsTemplate(@Param("id") String id,@Param("isTemplate") String isTemplate);

    public int retAmountInp(@Param("id") String id,@Param("chargeFlag") String chargeFlag);
}